package com.sbeam.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyWebConfiguration implements WebMvcConfigurer {

    //定义资源映射


    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //意思是：url中读取到image.sbeam.com/images/**时，就会自动解析成file:///D:/sbeam/images/
        registry.addResourceHandler("/images/**").addResourceLocations("file:D:/sbeam/images/");
    }
}
